<!DOCTYPE stack PUBLIC "-//Apple, Inc.//DTD stack V 2.0//EN" "" >
<stack>
<name>in</name>
<id>-1</id>
<cardCount>1</cardCount>
<cardID>2998</cardID>
<listID>2172</listID>
<cantModify><false /></cantModify>
<cantDelete><false /></cantDelete>
<cantAbort><false /></cantAbort>
<cardSize>
<width>512</width>
<height>342</height>
</cardSize>
<script>on openstackhide messagehide menubarglobal FinderHype, cntput the secs into cntput NewMenu("FinderHype","Help...","(-","Copy/9","Rename/8","Delete/7","(-","Restart","Shutdown") into FinderHypeif FinderHype = 0 then answer("Unable to make menu 'FinderHype'")show menubarif the version < 1.2 thenbeep 2answer "Your copy of FinderHype is for HyperCard 1.2."end ifend openstackon closestackhide menubarglobal FinderHypeput DeleteMenu (FinderHype) into MyMenupass closestackend closestackon idleglobal FinderHype, cntif (the secs - cnt) > 3 thenput the secs into cntput the time into card field "time" of card 1showMenu(FinderHype)end ifpass idleend idleon domenu whichif which = "Help..." thenvisual zoom outgo to this cardset visible of card field info to not visible of card field infoexit domenuend ifif which = "Copy" thenput "Select a file to copy ..."put filename() into oldFileput emptyhide messageif oldfile = empty then exit domenuput lastpathcomponent(oldfile) & ".new" into defaultget copyFile(oldFile,newfilename("",default))if it ≠ 0 then OSErr(itexit domenuend ifif which = "Rename" thenput "Please select a file to rename"put filename() into renamethisif renamethis = empty thenhide messageexit domenuend ifhide messageput LastPathComponent(renamethis) into shortnameask "What do you want to name this file?" with shortnameif it = shortname or it = empty thenhide messageput RenameFile(renamethis,it) into returnedthisif returnedthis = 0 then answer "File successfully renamed."else if returnedthis < 0 then OsErr returnedthiselse answer "Whoops, there was an error."end ifexit domenuend ifif which = "Delete" thenput "Please select a file to delete"put filename() into deletethisif deletethis = empty thenhide message windowexit domenuend ifhide message windowget lastpathcomponent(deletethis)answer "Delete" && quote & it & quote &"?" with "Cancel" or "OK"if it is "Cancel" then exit domenuput deletefile(deletethis) into returnedthisif returnedthis = 0 then answer "File Successfully Deleted"else if returnedthis < 0 then OsErr returnedthiselse answer "Sorry, there was an error"exit domenuend ifif which = "Shutdown" thenAnswer "Shut Down?" with Cancel or OKif it = "ok" then Shutdownexit domenuend ifif which = "Restart" thenAnswer "Restart?" with Cancel or OKif it = "ok" then DoRestartexit domenuend ifpass domenuend domenuon OsErr err-- Translate the most common onesif err > 0 then -- XFCN conventionput "Parameter error with function" into errstrelse if err is -59 thenput "Problem during rename" into errstrelse if err is -54 thenput "Attempt to open locked file for writing" into errstrelse if err is -46 thenput "Volume locked by software" into errstrelse if err is -45 thenput "File locked" into errstrelse if err is -44 thenput "Volume locked by hardware" into errstrelse if err is -43 thenput "File not found" into errstrelse if err is -37 thenput "Bad volume or file name" into errstrelse if err is -36 thenput "I/O error" into errstrelse if err is -35 thenput "No such volume" into errstrelse if err is -34 thenput "Disk is full" into errstrelse if err is -49 thenput "File already open for writing" into errstrelseput "Failed with error" && err into errstrend ifanswer errstr with "OK"end OsErrfunction LastPathComponent namerepeat with i = the length of name down to 1if character i of name is ":" then exit repeatend repeatif i is 1 thenif first character of name is ":" thenput 2 into iend ifelseadd 1 to i -- skip the colonend ifput empty into lastpathrepeat with j = i